const express = require("express");
const { pictures } = require("../upload");

const router = express.Router();

router.post("/upload", pictures.single("file"), async (req, res) => {
  res.send({
    success: true,
    object: "/pictures/" + req.file.filename,
  });
});

const registerRouter = (app) => {
  app.use("/picture", router);
};

module.exports = { registerRouter };
